package basic;

import java.io.Serializable;
import java.util.ArrayList;

public class ArrayListSource<T> implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5261716453011146621L;

	private Object[] objects;
	private Integer size;
	public ArrayListSource(int initSize){
		if(initSize<10){
			throw new RuntimeException("can't init size less 0");
		}
		this.objects=new Object[initSize];
	}
	public ArrayListSource(){
		//默认size10
		this(10);
	}
	private void ensureCapacity(int minCapacity){
		if(minCapacity>objects.length){
			//this.objects=Arrays.copyOf(objects, minCapacity);
		}
	}
	public boolean add(T t){
		objects[size++]=t;
		return true;
	}
	public static void main(String[] args) {
		ArrayList<String> arrayList=new ArrayList<String>();
	}
}
